/*
 * This file is part of Super Luigi Bros.
 * Super Luigi Bros is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Super Luigi Bros is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Super Luigi Bros.  If not, see <http://www.gnu.org/licenses/>.
 */

package luigibros.displayComponents;

import java.awt.Rectangle;
import java.awt.Image;
import java.awt.Dimension;


import luigibros.logic.ScreenOccupant;
/** This class creates Rectangles by converting
 *  images used by occupants and their locations to
 *  create the rectangles used for collision detection
 *  @author kalinich.mihilo@gmail.com && zking918@gmail.com, 
 *  absentFEAR420@gmail.com(Brandon Henrikson)
 */
@SuppressWarnings("all")
public class RectangleFactory extends Rectangle
{
	public double newX = 0.0;
	public double newY = 0.0;
	public Dimension newDim = new Dimension();
	public Image image;
	public ScreenOccupant occupant;
	
	public RectangleFactory(Image _image, ScreenOccupant occ)
	{
		image = _image;
		occupant = occ;		 
	}
	
	/** Receives two double values that act as coordinates
	 *  on the game grid and then sets them to the fields
	 *  newX and newY
	 *  @param x
	 *  @param y
	 *  @author kalinich.mihilo@gmail.com && zking918@gmail.com, 
	 *  absentFEAR420@gmail.com(Brandon Henrikson)
	 */
	public void setStartLocation(double x, double y)
	{
		newX = x;
		newY = y;
	}
	
	/** Sets the dimensions of the rectangle
	 *  @param dim
	 */
    public void setSize(Dimension dim)
    {
    	newDim = dim;
	}
    
    /**<getRectangle returns a new Rectangle
     *  with the image of
     * the character and the occupant
     * 
     *  @param image
     *  @param occupant
     *  @return 
     */
    public Rectangle getRectangle(Image image, ScreenOccupant occupant)
    {
    	Rectangle theRectangle = new RectangleFactory(image, occupant);
    	return theRectangle;
    	
    }
	
 
}